package cn.csc.module.member.controller.app.auth.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;

/**
 * @author liuchuang
 * @version 1.0
 * @date 2024/2/22 11:02
 * @modify
 */
@Schema(description = "用户 APP - 微信小程序手机登录 Request VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AppAuthWeixinMiniAppLoginWithPhoneReqVO {

    // 华智慧后端user_wx表已有用户数据
    @Schema(description = "用户ID", example = "1012")
    private Long userId;

    @Schema(description = "手机号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "13288888888")
    @NotEmpty(message = "手机号码不能为空")
    private String phone;

    @Schema(description = "登录 code,小程序通过 wx.login 方法获得", requiredMode = Schema.RequiredMode.REQUIRED, example = "word")
    @NotEmpty(message = "登录 code 不能为空")
    private String loginCode;

    /**
     * 访问AuthorizeUrl后回调时带的参数state，用于和请求AuthorizeUrl前的state比较，防止CSRF攻击
     * state是用来保持授权会话流程完整性，防止CSRF攻击的安全的随机的参数，由开发者生成
     */
    @Schema(description = "state", requiredMode = Schema.RequiredMode.REQUIRED, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
    @NotEmpty(message = "state 不能为空")
    private String state;


}
